package structures.grammar;

import structures.table.symboltable.NonTerminalInfo;
import structures.table.symboltable.TerminalItemInfo;
import structures.table.symboltable.TerminalType;

public class GrammarReaderDummy2 implements GrammarReader {

	@Override
	public Grammar parse(String fileName) {
		Grammar grammar = new Grammar();
        
        NonTerminalInfo S = new NonTerminalInfo("S");
        NonTerminalInfo C = new NonTerminalInfo("C");
        TerminalItemInfo c = new TerminalItemInfo("c", TerminalType.KEY_WORD);
        TerminalItemInfo d = new TerminalItemInfo("d", TerminalType.KEY_WORD);
        
        Rule rule1, rule2, rule3;
        
        rule1 = new Rule(S, new ItemList(C, C));
        rule2 = new Rule(C, new ItemList(c, C));
        rule3 = new Rule(C, new ItemList(d));
        
        grammar.put(rule1);
        grammar.put(rule2);
        grammar.put(rule3);
        
        return grammar;
	}

}
